<!--  -->
<template>
  <div class="home_nav">
    <div @click="toCate" class="nav_wrap">
      <div class="item">
        <img v-for="(v, i) in navs" :key="i" :src="v.image_src" alt="" />
      </div>
    </div>
  </div>
</template>

<script>
import { getNav } from "@/util/home.js";
export default {
  name: "HomeNav",
  data() {
    return {
      navs: [],
    };
  },
  created() {
    this.getNav();
  },
  methods: {
    async getNav() {
      let { data } = await getNav();
      this.navs = data.message;
    },
    toCate(){
      this.$router.push('/category')
    }
  },
};
</script>

<style scoped lang='less'>
.nav_wrap {
    padding: 15px 0;
  .item {
    display: flex;
    justify-content: space-around;
    width: 100%;
    img {
      width: 22%;
    }
  }
}
</style>